package com.dcivision.framework.taglib.channel;

import java.util.Comparator;

public class AjaxChannelPreferenceComparator implements Comparator {

  public int compare(Object o1, Object o2) {
    
    String preference1 = (String)o1;
    String preference2 = (String)o2;
    String[] preference1s = preference1.split("_");
    String[] preference2s = preference2.split("_");
    int sequence1 = Integer.parseInt(preference1s[3]);
    int sequence2 = Integer.parseInt(preference2s[3]);
    
    return (sequence1>sequence2?1:(sequence1==sequence2?0:-1));
  }


}
